
package model;
import java.sql.*;

import java.util.*;

import javax.naming.NamingException;

import db.DbConnectionPool;
import db.DbException;

public class SpecializationModel {
	private static String insertStr = "SELECT name FROM Specialization";
	public static Vector<String> getSpecialization() throws DbException{
		try{
			Connection conn = DbConnectionPool.getConnection();
			Statement stmt = conn.createStatement();
			ResultSet rs = stmt.executeQuery(insertStr);
		
			Vector<String> specialization = new Vector<String>();
			while (rs.next()) {
				specialization.add(rs.getString("name"));
			}
        rs.close();
        stmt.close();
        conn.close();
        return specialization;
        
		} catch (SQLException ex) {
            throw new DbException(ex);
		} catch (NamingException ex) {
			throw new DbException(ex);
		}
	}
}
